public class Goods
{
    Goods(String name, double weight, double prize, int acc_num, String scc_firm)
    {
        this._name = name;
        this._weight = weight;
        this._prize = prize;
        this._accessory_num = acc_num;
        this._accessory_firm = scc_firm;
    }
    @Override
    public String toString()
    {
        return ("商品：" + _name + " 重量:" + _weight + " 价格：" + _prize + " 配件数量：" + _accessory_num + " 制造厂商：" + _accessory_firm);
    }
    @Override
   public boolean equals(Object obj)
   {
       if(obj == this) return true;
       if(obj == null || obj.getClass() != this.getClass()) return false;
       Goods goods = (Goods) obj;
       return this._name.equals(goods._name) &&
               this._weight == goods._weight &&
               this._prize == goods._prize &&
               this._accessory_num == goods._accessory_num &&
               this._accessory_firm.equals( goods._accessory_firm);
   }

    public String get_name() {
        return _name;
    }

    public double get_weight() {
        return _weight;
    }

    public double get_prize() {
        return _prize;
    }

    public int get_accessory_num() {
        return _accessory_num;
    }

    public String get_accessory_firm() {
        return _accessory_firm;
    }

    private final String _name;
    private final double _weight;
    private final double _prize;
    private final int _accessory_num;
    private final String _accessory_firm;
}
